import axios from "@/http/http.js";

// 封装管理员自身信息修改接口
export const adminUpdateAPI = (data) => {
    return axios({
        url: '/user/update',
        method: 'put',
        data
    })
};

// 封装用户信息修改接口
export const updatePasswordAPI = (data) => {
    return axios({
        url: '/user/updatePassword',
        method: 'put',
        data,
        headers: { "content-type": "application/x-www-form-urlencoded" }
    })
};

// 封装用户登录接口
export const LoginAPI = (data) => {
    return axios({
        url: '/user/login',
        method: 'post',
        data,
        headers: { "content-type": "application/x-www-form-urlencoded" }
    })
};

// 封装用户登录接口
export const resetPasswordAPI = (data) => {
    return axios({
        url: '/user/resetPassword',
        method: 'put',
        data,
        headers: { "content-type": "application/x-www-form-urlencoded" }
    })
};

// 封装用户删除接口
export const deleteUserAPI = (data) => {
    return axios({
        url: '/user/deleteUser',
        method: 'put',
        data,
        headers: { "content-type": "application/x-www-form-urlencoded" }
    })
};

// 封装账号添加接口
export const addUserAPI = (data) => {
    return axios({
        url: '/user/register',
        method: 'post',
        data,
        headers: { "content-type": "application/x-www-form-urlencoded" }
    })
};

// 封装管理员信息获取接口
export const findAdminInfoAPI = (data) => {
    return axios({
        url: '/user/findAdmin',
        method: 'post',
        data
    })
};

// 封装管理员信息修改接口
export const adminInfoUpdateAPI = (data) => {
    return axios({
        url: '/user/updateAdmin',
        method: 'put',
        data
    })
};

// 封装医生和管理员角色账号获取接口
export const doctorAndAdminFindAPI = (data) => {
    return axios({
        url: '/user/findDoctorAndAdmin',
        method: 'post',
        data
    })
};

// 封装账号角色修改接口
export const roleUpdateAPI = (data) => {
    return axios({
        url: '/user/updateRole',
        method: 'put',
        data
    })
};